﻿#include "appendstudent.h"
#include "qmessagebox.h"
#include "ui_appendstudent.h"

appendStudent::appendStudent(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::appendStudent)
{
    ui->setupUi(this);

    this->setFixedSize(this->size());//锁定窗口大小
}

appendStudent::~appendStudent()
{
    delete ui;
}

void appendStudent::on_btnCancel_clicked()
{
    this->reject();
}


void appendStudent::on_btnOk_clicked()
{
    if(ui->editId->text().isEmpty() || ui->editName->text().isEmpty() || ui->spinAge->text() == 0 || ui->editClass->text().isEmpty()){
        QMessageBox::warning(0,"警告","信息不完整,请继续填写.");
        return;
    }
    emit this->appendStu(ui->editId->text(),ui->editName->text(),ui->combSex->currentText(),ui->spinAge->text(),ui->editClass->text());
    this->accept();
}

